Round tomtom values so they match on AMD64 & IA32. From Olaf.
authorrobertl <robertl@f51c46e8-681c-474f-0cfe-069cfd0219fb>
Mon, 9 May 2005 16:15:44 +0000 (16:15 +0000)
committerrobertl <robertl@f51c46e8-681c-474f-0cfe-069cfd0219fb>
Mon, 9 May 2005 16:15:44 +0000 (16:15 +0000)
gpsbabel/reference/ov2-arc-out.ref
gpsbabel/reference/ov2-geo-out.ref
gpsbabel/reference/ov2-in.ref
gpsbabel/tomtom.c

index f858319868c7654b36c3cefc4bbdb31567b9b091..11d8ddd12fdd656d02706ddf1b33d7fff88b0762 100644 (file)
Binary files a/gpsbabel/reference/ov2-arc-out.ref and b/gpsbabel/reference/ov2-arc-out.ref differ
index 39c0f7ca71a8103baa0c8799814887f4a9763085..95d3bb5f2cb79d34df902ee35ee37db68f06bbb0 100644 (file)
Binary files a/gpsbabel/reference/ov2-geo-out.ref and b/gpsbabel/reference/ov2-geo-out.ref differ
index 908e02e6c3f13f913663cb4e0c3262088f0ace10..4c0e75deecd82d968d197c1a598817afd05b897f 100644 (file)
@@ -1,9 +1,9 @@
 Mountain Bike Heaven by susy1313 3558.322N 08708.081W 0000000m Mountain Bike Heaven by susy13 a
-The Troll by a182pilot & Family 3605.441N 08640.773W 0000000m The Troll by a182pilot & Famil a
+The Troll by a182pilot & Family 3605.441N 08640.772W 0000000m The Troll by a182pilot & Famil a
 Dive Bomber by JoGPS & family 3559.776N 08637.207W 0000000m Dive Bomber by JoGPS & family  a
 FOSTER by JoGPS & Family 3602.309N 08638.917W 0000000m FOSTER by JoGPS & Family       a
 Logan Lighthouse by JoGps & Family 3606.731N 08644.506W 0000000m Logan Lighthouse by JoGps & Fa a
 Ganier Cache by Susy1313 3603.845N 08647.431W 0000000m Ganier Cache by Susy1313       a
-Shy's Hill by FireFighterEng33 3605.266N 08648.584W 0000000m Shy's Hill by FireFighterEng33 a
-GittyUp by JoGPS / Warner Parks 3603.449N 08653.519W 0000000m GittyUp by JoGPS / Warner Park a
-Inlighting by JoGPS / Warner Parks 3604.967N 08652.037W 0000000m Inlighting by JoGPS / Warner P a
+Shy's Hill by FireFighterEng33 3605.266N 08648.583W 0000000m Shy's Hill by FireFighterEng33 a
+GittyUp by JoGPS / Warner Parks 3603.450N 08653.519W 0000000m GittyUp by JoGPS / Warner Park a
+Inlighting by JoGPS / Warner Parks 3604.968N 08652.036W 0000000m Inlighting by JoGPS / Warner P a
index abce6e5d44c35d5ac871c038f5df7d7b80aef70c..ce75fb5a760d01b43e25424d0435f338b3916622 100644 (file)
@@ -169,6 +169,13 @@ write_long( FILE *file, long value ) {
         fwrite( &tmp, sizeof(tmp), 1, file );
 } 
 
+static void
+write_float_as_long( FILE *file, double value ) 
+{
+       long tmp = (value + 0.500000000001);
+       write_long( file, tmp);
+}
+
 static void
 write_char( FILE *file, unsigned char value ) {
        fwrite( &value, 1, 1, file );
@@ -197,10 +204,10 @@ write_blocks( FILE *f, struct blockheader *blocks ) {
        int i;
        write_char( f, 1 );
        write_long( f, blocks->size );
-       write_long( f, blocks->maxlon*100000 );
-       write_long( f, blocks->maxlat*100000 );
-       write_long( f, blocks->minlon*100000 );
-       write_long( f, blocks->minlat*100000 );
+       write_float_as_long( f, blocks->maxlon*100000 );
+       write_float_as_long( f, blocks->maxlat*100000 );
+       write_float_as_long( f, blocks->minlon*100000 );
+       write_float_as_long( f, blocks->minlat*100000 );
        if ( blocks->ch1 ) {
                write_blocks( f, blocks->ch1 );
        }
@@ -210,12 +217,10 @@ write_blocks( FILE *f, struct blockheader *blocks ) {
        if ( !blocks->ch1 && !blocks->ch2 ) {
                for ( i = 0; i < blocks->count; i++ ) {
                        write_char( f, 2 );
-                       write_long( f, 
-                               strlen( blocks->start[i].wpt->description ) 
-                               + 14 );
-                       write_long( f, blocks->start[i].wpt->longitude*100000);
-                       write_long( f, blocks->start[i].wpt->latitude*100000);
-                       write_string( f, blocks->start[i].wpt->description );
+                       write_long( f, strlen( blocks->start[i].wpt->description ) + 14 );
+                       write_float_as_long( f, blocks->start[i].wpt->longitude*100000);
+                       write_float_as_long( f, blocks->start[i].wpt->latitude*100000);
+                       write_string( f, blocks->start[i].wpt->description);
                }
        }
 }